package com.hhl.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hhl.entity.StudentInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/3/1.
 */
//@RestController
@Controller
public class IndexController {
    @RequestMapping("index")
    public String index(Map<String,Object> result){
        result.put("name","何海龙");
        result.put("age","19");
        result.put("sex", "0");
        
        List<StudentInfo> list = new ArrayList<StudentInfo>();
        StudentInfo info = new StudentInfo();
        info.setAge("19");
        info.setName("何海龙");
        info.setSex("0");
        list.add(info);
        
        StudentInfo info1 = new StudentInfo();
        info1.setAge("20");
        info1.setName("李四");
        info1.setSex("1");
        list.add(info1);
        result.put("list",list);
        
        
        List<String> list2 = new ArrayList<>();
        list2.add("你好");
        list2.add("springboot");
        result.put("list2", list2);
        
        return "index";
    }



}
